home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Amiga Format CD 38
/
Amiga Format CD38 (1999-03-15)(Future Publishing)(GB)(Track 1 of 3)[!][issue 1999-04].iso
/
-seriously_amiga-
/
misc
/
ced_html
/
html
/
html_formular_single.ced
< prev
next >
Wrap
Text File
|
1999-01-25
|
5KB
|
168 lines
/*
** html_formular_single.ced
**
** $VER: html_formular_single.ced 1.6 (01.04.1999)
**
** Arexx script for HTML v3.2 formular single line input
**
** This script works with CygnusEd Professional v4.2
**
** Copyright © Eric BELLE
*/
/*
**------------------------------------------------------------------------------
** Initialisation
**------------------------------------------------------------------------------
*/
OPTIONS RESULTS /* Tell CygnusEd to return results. */
NL = '0A'X /* Alias for new line. */
KRETURN = RAWKEY 68 /* Shortcut to the return key. */
KTAB = RAWKEY 66 /* Shortcut to the tab key. */
STATUS TABSARESPACES /* Return TAB mode ("tab" or "space"). */
IF RESULT = 1 /* Test the TAB mode. */
THEN "TABS = SPACES" /* Switch TAB mode from "space" to "tab". */
ELSE NOP /* No operation. */
TAB SIZE 1 /* Set TAB size proportional to 2 spaces. */
/*
**------------------------------------------------------------------------------
** Input identification name
**------------------------------------------------------------------------------
*/
GETSTRING '"Name"' '"Indentification name for the input?"'
InputName = RESULT
IF (InputName=" " | InputName="RESULT")
THEN EXIT 0
ELSE NOP
/*
**------------------------------------------------------------------------------
** Real input size
**------------------------------------------------------------------------------
*/
GETNUMBER 10 '"Real input size?"' 0 32768
RealInputSize = RESULT
IF (RealInputSize=" ")
THEN EXIT 0
ELSE NOP
/*
**------------------------------------------------------------------------------
** Apparent input size
**------------------------------------------------------------------------------
*/
GETNUMBER 5 '"Visual input size?"' 0 32768
ApparentInputSize = RESULT
IF (ApparentInputSize=" ")
THEN EXIT 0
ELSE NOP
/*
**------------------------------------------------------------------------------
** Input type
**------------------------------------------------------------------------------
*/
InputType = "no"
Do While (InputType="no")
OKAY2 "Data type:" || NL ||,
"~~~~~~~~~" || NL ||,
" (t)ext | (d)ate " || NL ||,
" (i)nteger | (U)RL " || NL ||,
" (f)loat | (p)assword "
IF (RESULT=0)
THEN EXIT 0
ELSE InputType="ok"
InputTypeMode = "q"
DO WHILE ~(InputTypeMode="t" | InputTypeMode="i" | InputTypeMode="f",
| InputTypeMode="d" | InputTypeMode="U" | InputTypeMode="p",
| InputTypeMode="RESULT" | InputTypeMode=" ")
GETSTRING "t" '"Data type mode: t, i, f, d, U, p?"'
InputTypeMode = RESULT
END
IF (InputTypeMode="RESULT" | InputTypeMode=" ")
THEN InputType = "no"
ELSE NOP
END
/*
**------------------------------------------------------------------------------
** Input bounds
**------------------------------------------------------------------------------
*/
IF (InputTypeMode="i" | InputTypeMode="f")
THEN DO
GETNUMBER 1 '"Lower bound?"'
LowerBound = RESULT
IF (LowerBound=" ")
THEN EXIT 0
ELSE NOP
GETNUMBER 10 '"Upper bound?"'
UpperBound = RESULT
IF (UpperBound=" ")
THEN EXIT 0
ELSE NOP
END
ELSE NOP
/*
**------------------------------------------------------------------------------
** Html Input marks
**------------------------------------------------------------------------------
*/
InputString = '<INPUT NAME="' || InputName || '"'
InputString = InputString || " SIZE=" || ApparentInputSize
InputString = InputString || " MAXLENGTH=" || RealInputSize
SELECT
WHEN (InputTypeMode="t") THEN InputString = InputString || ">"
WHEN (InputTypeMode="i") THEN DO
InputString = InputString || " TYPE=INT"
InputString = InputString || " MIN=" || LowerBound
InputString = InputString || " MAX=" || UpperBound
InputString = InputString || ">"
END
WHEN (InputTypeMode="f") THEN DO
InputString = InputString || " TYPE=FLOAT"
InputString = InputString || " MIN=" || LowerBound
InputString = InputString || " MAX=" || UpperBound
InputString = InputString || ">"
END
WHEN (InputTypeMode="d") THEN InputString = InputString || " TYPE=DATE" || ">"
WHEN (InputTypeMode="U") THEN InputString = InputString || " TYPE=URL" || ">"
WHEN (InputTypeMode="p") THEN InputString = InputString || " TYPE=PASSWORD" || ">"
OTHERWISE NOP
END
/*
**------------------------------------------------------------------------------
** Html Input structure
**------------------------------------------------------------------------------
*/
TEXT InputString
/*
**------------------------------------------------------------------------------
** End of html_formular_single.ced Arexx script
**------------------------------------------------------------------------------
*/
EXIT 0